package com.miyu.video.dao;

import com.miyu.common.pojo.system.SysRule;
import com.miyu.common.utils.basedao.BaseDao;
import org.springframework.data.domain.Example;
import org.springframework.stereotype.Repository;


/**
 * 系统规则
 * @author MIYU
 */
@Repository
public interface VideoDao extends BaseDao<SysRule, String> {

    /**
     * 找到一个
     * @param ruleId 规则id
     * @return {@link SysRule}
     */
    default SysRule findByRuleId(String ruleId) {
        SysRule rule = new SysRule();
        rule.setRuleId(ruleId);
        Example<SysRule> example = Example.of(rule);
        SysRule sysRule  = findOne(example).orElse(null);
        return sysRule;
    }
}